package com.atguigu.testdemo;

import com.atguigu.annotation.Person;
import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * 测试 ：以四种注解的方式进行创建对象
 */
public class TestAnnotation {
    @Test
    public void test1() {
        ApplicationContext context = new ClassPathXmlApplicationContext("annotation.xml");
        Person person = context.getBean("person", Person.class);
        Person person1 = (Person) context.getBean("person");
        System.out.println(person);
        System.out.println(person1);
        person.show();
    }
}
